/**
 * MyBooksMenu
 * https://github.com/internetarchive/openlibrary/wiki/Design-Pattern-Library#mybooksmenu
 *
 * http://localhost:8080/account/books/want-to-read
 */
.mybooks-menu {
  max-width: none !important; /** fix in media query */
  width: 250px;
  flex-shrink: 0;
  border-right: 1px solid @lightest-grey;
  border-bottom: none;
  border-radius: 7px 0 0 7px;
  background: @grey-fafafa;
  box-shadow: inset -4px 0 10px @lightest-grey;
  padding: 0;
  padding-top: 13px;
  position: sticky;
  height: 100vh;
  top: 0;
  overflow-y: auto;

  .external-link {
    text-decoration: underline;
  }

  a {
    text-decoration: none;
    color: @link-blue;
  }
  /*all uls */
  .sidebar-section {
    padding: 0 0 10px;
    border-bottom: 1px solid @lightest-grey;
  }

  .sidebar-section .list-overflow {
    max-height: unset;
    overflow: auto;
  }

  ul:last-child {
    border-bottom: none;
  }

  ul li {
    list-style: none;
    a.selected {
      background-color: @grey-blue;
      border-radius: 4px;
      padding: 5px 11px;
      margin: 2px 4px;
      font-weight: bold;
    }
  }
  ul li a {
    display: block;
  }

  ul li:not(.section-header) a {
    display: block;
    padding: 4px 15px;

    @media (pointer: coarse) {
      padding: 8px 15px;
    }

    /* stylelint-disable selector-max-specificity */
    &.selected {
      padding: 4px 11px;
    }
    /* stylelint-enable selector-max-specificity */
  }

  ul li.section-header {
    padding: 4px 15px;
    text-transform: uppercase;
    font-weight: bold;
    font-size: .8em;
    color: @grey;
    background: @background-grey;
    border: 1px solid @lighter-grey;
    border-left: 0;
    border-right: 0;
    margin-bottom: 5px;
  }

  /* 'create a list' within sidebar */
  ul li.create-new-list {
    text-align: center;
    padding: 6px 0;

    > a {
      display: inline-block;
      border-radius: 5px;
      cursor: pointer;
      padding: 2px 5%;
      font-size: .96em;
      background-color: @background-grey;
      border: 1px solid @lighter-grey;
      color: @grey;
    }
  }

  /* stylelint-disable selector-max-specificity */
  .section-header.section-header-split::after {
    clear: both;
    display: block;
    content: "";
  }
  /* stylelint-enable selector-max-specificity */

  .section-header.section-header-split {
    padding: 0;

    /* stylelint-disable selector-max-specificity */
    > :first-child {
      padding: 4px 15px;
      display: inline-block;
    }

    > a {
      padding: 4px 15px 4px 1px;
    }
    /* stylelint-enable selector-max-specificity */
  }

  hr {
    height: 0;
    margin: 4px 14px;
    border-bottom: 1px solid @lighter-grey;
  }

  .li-count {
    position: relative;
    float: right;
    font-size: .9em;
    margin-top: 1px;
    color: @count-blue-grey;
    margin-left: 4px;
  }

  /* stylelint-disable selector-max-specificity */
  .li-count.chevron:after {
    content: "\203A";
    margin: 0 5px;
    position: absolute;
    font-size: 1.5em;
    font-weight: normal;
    top: 50%;
    transform: translateY(-50%);
    right: 0;
    height: 100%;
  }
  /* stylelint-enable selector-max-specificity */
}

@media only screen and (max-width: @width-breakpoint-tablet) {
  .mybooks-menu {
    display: none;
  }

  .mybooks-menu-mobile{
    max-width: none !important; /** fix in media query */
    flex-shrink: 0;
    border-right: 1px solid @lightest-grey;
    border-bottom: none;
    border-radius: 7px 0 0 7px;
    background: @white;
    padding: 0;
    padding-top: 13px;
    position: sticky;
    top: 0;
    overflow-y: visible;

    .external-link {
      text-decoration: underline;
    }

    a {
      text-decoration: none;
      color: @link-blue;
    }
    /*all uls */
    .sidebar-section {
      margin: 0 0 20px;
      border-bottom: 1px solid @light-mid-grey;
    }

    .sidebar-section .list-overflow {
      max-height: unset;
      overflow: auto;
    }

    ul li {
      background: @lighter-grey;
      list-style: none;
      a.selected {
        background-color: @grey-blue;
        border-radius: 4px;
        padding: 5px 11px;
        margin: 2px 4px;
        font-weight: bold;
      }
    }
    ul li a {
      display: block;
      font-size: 4vw;
      font-weight: 400;
    }

    .carousel-section-header {
      display: block;
      padding: 10px 15px;

      @media (pointer: coarse) {
        padding: 8px 15px;
      }

      /* stylelint-disable selector-max-specificity */
      &.selected {
        padding: 4px 11px;
      }
      /* stylelint-enable selector-max-specificity */
    }

    ul li.section-header {
      padding: 4px 15px;
      text-transform: uppercase;
      font-weight: bold;
      font-size: .8em;
      color: @grey;
      background: @background-grey;
      border: 1px solid @lighter-grey;
      border-left: 0;
      border-right: 0;
      margin-bottom: 5px;
    }

    /* stylelint-disable selector-max-specificity */
    .section-header.section-header-split::after {
      clear: both;
      display: block;
      content: "";
    }
    /* stylelint-enable selector-max-specificity */

    .section-header.section-header-split {
      padding: 0;

      /* stylelint-disable selector-max-specificity */
      > :first-child {
        padding: 4px 15px;
        display: inline-block;
      }

      > a {
        padding: 4px 15px 4px 1px;
      }
      /* stylelint-enable selector-max-specificity */
    }

    hr {
      height: 0;
      margin: 4px 14px;
      border-bottom: 1px solid @lighter-grey;
    }

    .li-count {
      float: right;
      font-size: .9em;
      margin-top: 1px;
      color: @count-blue-grey;
      margin-left: 4px;
    }
  }

  .li-title-desktop {
    display: none;
  }
}

@media only screen and (min-width: (@width-breakpoint-tablet + 1)) {
  .mybooks-menu-mobile {
    display: none;
  }
  .mybooks-menu {
    width: 200px;  // 250px width + 75% width in `.mybooks-details {}` causes overflow.
  }
}

@media only screen and (min-width: (@width-breakpoint-desktop + 1)) {
  .mybooks-menu {
    width: 250px;  // Desktops are fine with the wider menu.
  }
}
